package com.eva.ss.session;

import com.eva.framework.rbac.session.SessionAdapter;
import com.eva.ss.model.SsUserInfo;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

@Component
public class SsSessionAdapter implements SessionAdapter {

    @Override
    public SsUserInfo getLoginUser() {
        return (SsUserInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
